#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define int long long 
#define fread(x) ios::sync_with_stdio(x)

using namespace std;  
signed main()  
{  
	char num[3]={};
	cin >> num[0] >> num[1] >> num[2];
	do  
	{  
		cout<<num[0]<<num[1]<<num[2]<<endl;  
	}while(next_permutation(num,num+3));  
	return 0;  
}  
